Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update has_mask method for mmdet models (handle ConcatDataset) #1092

Merged
merged 8 commits into from
Nov 22, 2024

Conversation

ccomkhj
Copy link
Contributor

@ccomkhj ccomkhj commented Oct 31, 2024

train_dataloader = dict(
    batch_size=batch_size,
    num_workers=batch_size,
    persistent_workers=True,
    sampler=dict(type="DefaultSampler", shuffle=True),
    batch_sampler=dict(type="AspectRatioBatchSampler"),
    dataset=dict(type="ConcatDataset", datasets=train_datasets),
)

When ConcatDatasaet is used for train_dataloader, it throws an error.

File "/.../miniconda3/envs/mmdet2/lib/python3.8/site-packages/mmengine/config/config.py", line 105, in __missing__
    raise KeyError(name)
KeyError: 'pipeline'
self.model.cfg["train_dataloader"]['dataset']
{'datasets': [{...}, {...}], 'type': 'ConcatDataset'}

self.model.cfg["train_dataloader"]['dataset']['datasets']
[{'ann_file': 'annotations/instances_train.json', 'backend_args': None, 'data_prefix': {...}, 'data_root': '/mmdet/data/...', 'filter_cfg': {...}, 'metainfo': {...}, 'pipeline': [...], 'type': 'CocoDataset'}, {'ann_file': 'annotations/instances_train.json', 'backend_args': None, 'data_prefix': {...}, 'data_root': '/mmdet/data/...', 'filter_cfg': {...}, 'metainfo': {...}, 'pipeline': [...], 'type': 'CocoDataset'}]

This PR handles ConcatDatasaet case.

@fcakyon
Copy link
Collaborator

fcakyon commented Nov 22, 2024

thanks again for your contributiins! @ccomkhj

@fcakyon fcakyon self-requested a review November 22, 2024 07:18
@fcakyon fcakyon added this pull request to the merge queue Nov 22, 2024
Merged via the queue into obss:main with commit de40562 Nov 22, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants